package com.dotflat.vod.domain;

import com.dotflat.rest.domain.AreableObjectBase;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "op_vod_category")
@Data
@EqualsAndHashCode(callSuper = true)
public class OPVodCategory extends AreableObjectBase {

	@Column(columnDefinition = "longtext  COMMENT '协议标题'")
	private String title = "";

	@Column(columnDefinition = "varchar(512) COMMENT '封面'")
	private String cover;

//	@Column(columnDefinition = "varchar(64) COMMENT '模板id'")
//	private String templateId;
//	@Column(columnDefinition = "varchar(32) COMMENT '班级id'")
//	private String classId;
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "category")
	@OrderBy("created DESC")
	@JsonIgnore
	private List<OPVodItem> items;

}
